home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK2.toast / Development Kits (Disc 2) / ScriptX / Draggable ScriptX Folders / utils / DTK / Examples / Custom Classes / Playsnd.cls < prev    next >
Encoding:
Text File  |  1995-10-27  |  524 b   |  25 lines  |  [TEXT/ttxt]

  1. format debug "--  Compiling PlaySndAction Class . . .\n" undefined undefined
  2.  
  3. class PlaySndAction (Action)
  4.  
  5.     instance variables
  6.         dap
  7. end
  8.  
  9. method init self {class PlaySndAction} #rest args #key sndStream:(undefined) buffer:->
  10. (    
  11.     apply nextMethod self args
  12.     
  13.     self.dap := new DigitalAudioPlayer mediaStream:sndStream bufSize:buffer
  14.     return self
  15. )
  16.  
  17. method trigger self {class PlaySndAction} theTarget thePlayer ->
  18. (    
  19.     local dap := self.dap
  20.     gotoBegin dap
  21.     playUntil dap dap.duration
  22. )
  23.  
  24. #(PlaySndAction, undefined, undefined)
  25.